package com.bw.app.dwm;

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Test {
    public static void main(String[] args) throws ParseException {
//        String birthday = "1990-02-03";
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//        System.out.println(sdf.parse(birthday).getTime());

//        String birthday1 = "1990-02-03 00:00:00";
//        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
//        System.out.println(sdf1.parse(birthday1).getTime());


//        String birthday = "1968-12-04 11:23:00";
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//        long now = System.currentTimeMillis();
//        long time = sdf.parse(birthday).getTime();
//        int age = (int) ((now - time) / (1000 * 60 * 60 * 24 * 365));
//        int age2 = (int) ((now - time) / (1000 * 60 * 60 * 24 * 365L));
//        System.out.println("age = " + age);
//        System.out.println("age2 = " + age2);

                String birthday2 = "1968-12-04";
        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        long now2 = System.currentTimeMillis();
        long time2 = sdf2.parse(birthday2).getTime();
        long age2 = (now2 - time2) / (1000 * 60 * 60 * 24 * 365L);
//
    }
}
